/***************************************************************************
 * File name: EPubMediaXHtmlImp.h
 * Original author: caizhifei2003@163.com
 * Date: 2013.03.01
 ***************************************************************************/
#ifndef _EPUB_MEDIA_XHTML_IMP_H_
#define _EPUB_MEDIA_XHTML_IMP_H_

#include "IEPubMediaXHtml.h"
#include "EPubBufferImp.h"
#include <string>

class EPubMediaXHtmlImp : public IEPubMediaXHtml
{
public:
	EPubMediaXHtmlImp();
	
	virtual EPUB_MediaFileType GetMediaFileType() const { return EPUB_MFT_XHTML; }
	virtual const char *GetHref() const { return m_Href.c_str(); };
	virtual void SetHref(const char *href) { m_Href = href; }

	virtual EPubPointer<IEPubBuffer> Serialize(EPubPointer<IEPubEncryption> encryption = NULL) const;
	virtual EPUB_Result Deserialize(const EPubPointer<IEPubBuffer> buffer, EPubPointer<IEPubDecryption> decryption = NULL);

	virtual const char *GetContent() const { return m_Content.c_str(); }
	virtual void SetContent(const char *content) { m_Content = content; }

private:
	std::string						m_Href;
	std::string						m_Content;
};

#endif // _EPUB_MEDIA_XHTML_IMP_H_